<template>
	<view class="recruit">
		<Navbar>招募</Navbar>
		<scroll-view scroll-y class="scroll_view">
			<view class="content">
				<view class="show_view">
					<image :src="`${baseImageUrl}/test/2.png`" class="cover"></image>
					<view class="info">邀请码 {{invitation_code}}</view>
				</view>
			</view>
			<view class="tabs">
				<view class="item" @click="copy(register_url)">
					<image :src="`${baseImageUrl}/home/r1.png`"></image>
					<text>复制链接</text>
				</view>
				<view class="item" @click="copy(invitation_code)">
					<image :src="`${baseImageUrl}/home/r2.png`"></image>
					<text>复制邀请码</text>
				</view>
				<view class="item">
					<image :src="`${baseImageUrl}/home/r3.png`"></image>
					<text>保存本地</text>
				</view>
				<view class="item" @click="router('/pages/home/friends')">
					<image :src="`${baseImageUrl}/home/r4.png`"></image>
					<text>好友列表</text>
				</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	import {
		register
	} from "@/utils/config.js"
	export default {
		data() {
			return {
				invitation_code: "",
				register_url: ""
			}
		},
		onLoad(option) {
			this.invitation_code = this.$store.state.info.invitation_code;
			this.register_url = `${register}?code=${this.invitation_code}`;
		}
	}
</script>

<style scoped lang="scss">
	.recruit {
		height: 100vh;
		background: #29170D;
		overflow: hidden;

		.scroll_view {
			height: calc(100vh - #{$navbarHeight});
		}

		.content {
			width: 100%;
			height: 1002rpx;
			padding: 0 94rpx 66rpx;
			box-sizing: border-box;
			background: url(#{$baseImageUrl}/bg/bg5.png) no-repeat;
			background-size: 100% 100%;
			display: flex;
			align-items: flex-end;

			.show_view {
				width: 100%;
				height: 200rpx;
				padding: 28rpx 22rpx;
				box-sizing: border-box;
				background: url(#{$baseImageUrl}/bg/564_200.png) no-repeat;
				background-size: 100% 100%;
				display: flex;

				.cover {
					width: 150rpx;
					height: 150rpx;
				}

				.info {
					color: #000000;
					font-size: 30rpx;
					font-weight: 400;
					font-family: SimSun;
					padding-top: 22rpx;
					padding-left: 26rpx;
					box-sizing: border-box;
				}
			}
		}

		.tabs {
			width: 100%;
			padding: 34rpx 70rpx 0;
			box-sizing: border-box;
			display: flex;
			justify-content: space-between;

			.item {
				display: flex;
				flex-direction: column;
				justify-content: center;
				align-items: center;

				image {
					width: 100rpx;
					height: 100rpx;
				}

				text {
					color: #FFFFFF;
					font-size: 28rpx;
					font-weight: 400;
					font-family: SimSun;
				}
			}
		}
	}
</style>